const accessToken = 'accessToken'
const refreshToken = 'refreshToken'

//保存token和refrshToken
export function setToken(token, refToken) {
    localStorage.setItem(accessToken, token);
    localStorage.setItem(refreshToken, refToken);
}

//获取Token
export function getToken() {
    return localStorage.getItem(accessToken)
}

//获取refreshToken
export function getRefreshToken() {
    return localStorage.getItem(refreshToken)
}
//删除Token和refreshToken
export function removeToken() {
    localStorage.removeItem(accessToken)
    localStorage.removeItem(refreshToken)
}

//判断是否已经获取token（是否登录）
export function IsAuth() {
    let IsToken = getToken();
    if (IsToken) {
        return true
    } else {
        return false
    }
}